package com.global.emc.core.chain;

import java.util.List;

import com.global.emc.core.chain.command.Command;
import com.global.emc.core.exception.impl.EMCException;

public class SimpleChain<T extends Object> implements Chain<T> {
	
	private List<Command<T>> commands;

	@Override
	public List<Command<T>> getCommands() {
		return commands;
	}
	@Override
	public void setCommands(List<Command<T>> commands) {
		this.commands=commands;
	}

	@Override
	public void invoker(T content) throws EMCException {
		for(Command<T> command : commands){
			command.execute(content);
		}
	}

}
